package com.ht.medicaltreatment.activity

import android.view.View
import androidx.activity.viewModels
import androidx.recyclerview.widget.LinearLayoutManager
import com.gym.baselib.base.BaseActivity
import com.ht.medicaltreatment.R
import com.ht.medicaltreatment.adapter.ReturnDetailAdapetr
import com.ht.medicaltreatment.adapter.ReturnTimeOutDetailAdapetr
import com.ht.medicaltreatment.adapter.SampleReturnAdapetr
import com.ht.medicaltreatment.viewmodel.ReturnRecordViewModel
import kotlinx.android.synthetic.main.activity_return_record_detail_layout.*

//超时表单详情
class ReturnTimeOutOrderDetailActivity:BaseActivity() {
    override fun getLayoutId() = R.layout.activity_return_record_detail_layout
    private val model by viewModels<ReturnRecordViewModel>()

    private val adapter = ReturnTimeOutDetailAdapetr()
    override fun init() {
        setTitle("表单详情")

        recyclerView.layoutManager = LinearLayoutManager(this)
        recyclerView.adapter = adapter

        val id = intent.getStringExtra("id")
        val value = intent.getIntExtra("value",-10086)

        titleRangTime.visibility = View.GONE
        tvStartTime.visibility = View.GONE
        tvEndTime.visibility = View.GONE
        line3.visibility = View.GONE
        line.visibility = View.GONE

        showProgress()
        model.returnTimeOutOrderDetail(id!!,value,{
            dismissProgress()
            adapter.setNewInstance(it)
            tvCount.text = "${it?.size}"
        })
    }
}
